// action-types
export const types = {
  SHOW_LOADING: 'SHOW_LOADING'
}

// state
const initialState = {
  doShowLoading: false,
  alertText: ''
}

// action
export const showLoading = () => ({ type: types.SHOW_LOADING })

// reducer
const alert = (state = initialState, action: any) => {
  // switch (action.type) {
  //   case SHOW_LOADING:
  //     return { ...state, doShowLoading: true }
  //   case HIDE_LOADING:
  //     return { ...state, doShowLoading: false }
  //   case SHOW_ALERTTEXT:
  //     return { doShowLoading: false, alertText: action.doc }
  //   case HIDE_ALERTTEXT:
  //     return { doShowLoading: false, alertText: null }
  //   default:
  //     return state
  // }
}

export default alert

// selector
export const getDoShowLoading = (state: any) => state.alert.doShowLoading
export const getAlertText = (state: any) => state.alert.alertText